package mest.service.Modeling.Impl;

import mest.VO.Modeling.WarehouseSaveFile_manytomany.savefileVO;
import mest.dao.Modeling.IwarehouseFileDao;
import mest.entity.warehouse_file;
import mest.entity.warehousesave_manytomany;
import mest.service.Modeling.IwarehouseFileService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @auther Machenike
 * @create 2019-11-16 1:27
 */
@Service
public class WarehouseFileServiceImpl implements IwarehouseFileService {

    @Resource
    private IwarehouseFileDao iwfd;

    @Override
    public int insertWarehouseFileType(warehouse_file ct) {
        try {
            return iwfd.insertWarehouseFileType(ct);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public int selectCount() {
        return iwfd.selectCount();
    }

    @Override
    public List<warehouse_file> findWarehouseFilePage(int index, int pageSize) {
        return iwfd.findWarehouseFilePage((index-1)*pageSize,pageSize);
    }

    @Override
    public List<savefileVO> findSaveByWFId(int wfId, int index, int pageSize) {
        return iwfd.findSaveByWFId(wfId,(index-1)*pageSize,pageSize);
    }

    @Override
    public int SaveCount(int id) {
        return iwfd.SaveCount(id);
    }

    @Override
    public int insertManytomany_WarehouseAndSave(warehousesave_manytomany wsmtm) {
        return iwfd.insertManytomany_WarehouseAndSave(wsmtm);
    }

    @Override
    public int updateManytomany_WarehouseAndSave(savefileVO wsmtm) {
        return iwfd.updateManytomany_WarehouseAndSave(wsmtm);
    }
}
